package com.ssyt.yt1.day17;

import java.util.Arrays;
import java.util.Set;
import java.util.TreeSet;

/**
 * 连接两个数组，去重，排序！
 * 
 * @author Administrator
 *
 */
public class CollectionDemo {

	public static void main(String[] args) {
		Integer[] numbers1 = { 11, 4, 4 };
		Integer[] numbers2 = { 2, 36, 4 };
		// Set里面的内容不能有重复
		Set<Integer> set1 = new TreeSet<Integer>(Arrays.asList(numbers1));
		Set<Integer> set2 = new TreeSet<Integer>(Arrays.asList(numbers2));
		// 把两个Set相加
		set1.addAll(set2);

		System.out.println(set1);
	}
}
